package com.agil.photoalbum.swing.admin;

import javax.swing.JButton;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Font;
import javax.swing.border.MatteBorder;
import javax.swing.border.TitledBorder;

/**
 *
 * @author Hovanessyan
 */
public class SwingStyles {
     
    private static final Color ORANGE = new java.awt.Color(255, 204, 0);
    private static final Color WHITE = new java.awt.Color(255, 255, 255);
    
    Font defFont = new java.awt.Font("Tahoma", 1, 11);

    
    public SwingStyles(){
    }
    
    
    public void setBtnStyle(JButton btn, String btnText) {
        btn.setText(btnText);
        btn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btn.setForeground(ORANGE);
        btn.setBackground(WHITE); 
    }
       
    public void setBtnStyle(JButton btn, String btnText, String tooltip){
        SwingStyles.this.setBtnStyle(btn, btnText);
        btn.setToolTipText(tooltip);
    }
    
    public void setPanelStyle(JPanel panel, String borderText){
        MatteBorder matteBorder = javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, ORANGE);
        TitledBorder titledBorder = javax.swing.BorderFactory.createTitledBorder(matteBorder, borderText, javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, defFont, ORANGE);
        panel.setBackground(WHITE);
        panel.setBorder(titledBorder);
        
    }

}
